from django.urls import path
from rest_framework.routers import SimpleRouter

from study.views import StudentViewSet, ClassesViewSet

urlpatterns = [
    #     path('student/', StudentViewSet.as_view({'get': 'list', 'post': 'create'})),
    #     path('student/<pk>/', StudentViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'})),
]

router = SimpleRouter()  # 实例化路由器
router.register('student', StudentViewSet)  # 注册路由
router.register('classes', ClassesViewSet)  # 注册路由
urlpatterns += router.urls  # 获取生成的路由地址，加到地址集合中去
